package com.xrit.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.xrit.mapper.MemberMapper;
import com.xrit.service.MemberService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.ArrayList;
import java.util.List;

@Service
public class MemberServiceImpl implements MemberService {

    @Autowired
    private MemberMapper memberMapper;

    @Override
    public List<Integer> getMemberReport(List<String> months) {
        List<Integer> count=new ArrayList<>();
        if (months!=null && months.size()>0){
            months.forEach(m->{
                Integer c = memberMapper.findMemberCountBeforeDate(m + ".01");
                count.add(c);
            });
        }
        return count;
    }
}
